package com.childenglish.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 角色验证注解
 * 验证角色值是否为有效的角色
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = ValidRoleValidator.class)
@Documented
public @interface ValidRole {
    String message() default "角色值不正确，必须是: admin, parent, child, teacher 之一";
    
    Class<?>[] groups() default {};
    
    Class<? extends Payload>[] payload() default {};
}

